package chwgigs_jdbc;

import java.util.Scanner;

public class EX02_AccountService implements EX02_IAccountService{
	private static EX02_AccountDAO adao = new EX02_AccountDAO();

	@Override
	public void createAccount() {
		 System.out.println("은행계좌");
	     Scanner sc= new Scanner(System.in);
		 
	     EX02_AccountVO c =new EX02_AccountVO();
	     System.out.println("인출");
	     c.setAid(sc.nextInt());
	     System.out.println("잔액");	
	     c.setBalance(sc.nextInt());
	    
		 System.out.println(":월간 이자율");
		c.setInterestRate(sc.nextInt());
		
		if(adao.insertAccount(c))
			System.out.println("계좌 생성 완료");
		else
			System.out.println("계좌 생성 실패");
		
	}

	/*@Override
	public void readMember() {
	for(EX02_AccountVO m:adao.selectAccount()){
		System.out.println(m.getAid());
		System.out.println("/");
		System.out.println(m.getBalance());
	    System.out.println("/");
	    System.out.println(m.getDateCreated());
	    System.out.println(m.getInterestRate()); */
	    
	
		
	

	/*@Override
	public void modifyMember() {
	  readMember();
	  EX02_AccountVO avo = new EX02_AccountVO();
	  Scanner sc=new Scanner(System.in);
	  System.out.println("수정할 잔액을 입력해라");
	  avo.setAid(sc.nextInt());
	  System.out.println("수정할 월간 이자율을 입력해라"); */
	  
	

	@Override
	public void removeMember() {
		
		
	}

	@Override
  public float getMonthlyInterestRate(){

 
			return interestRate / 12;
		}
	
	

	@Override
	public void withdraw() {}
		static int withDraw(int balance, int draw) {
			return balance - draw;
		}
		
	

	@Override
	public void deposit() {}
		static int deposit(int balance, int deposit) {
			return balance + deposit;
		}

		@Override
		public void readMember() {
	
			
		}

		@Override
		public void modifyMember() {
	
			
		}
		
}
